

import request from '@/utils/request';


export async function listDirs(projectId, docType) {
  return request(`/project/${projectId}/doc/listDirs`, {
    method: 'GET',
    params: {
      docType: docType
    }
  });
}

export async function mkdir(projectId, data) {
  return request(`/project/${projectId}/doc/mkdir`, {
    method: 'POST',
    data: data
  });
}


export async function updateDir(projectId, dirId, data) {
  return request(`/project/${projectId}/doc/updateDir/${dirId}`, {
    method: 'POST',
    data: data
  });
}

export async function historyList(projectId, docType, docId) {
  return request(`/project/${projectId}/doc/history/${docType}/${docId}`, {
    method: 'GET',
    params: {
      pageSize: 20
    }
  });
}

export async function historyDocDetail(projectId, docType, docId, historyId) {
  return request(`/project/${projectId}/doc/history/${docType}/${docId}/${historyId}`, {
    method: 'GET',
  });
}


export async function docLike(projectId, docType, docId, isLike) {
  return request(`/project/${projectId}/doc/like/${docType}/${docId}`, {
    method: 'POST',
    data: {
      isLike: isLike
    }
  });
}